package io.finer.erp.jeecg.stock.service;

import java.util.List;
import java.util.Map;

import org.jeecg.common.api.vo.Result;

import com.alibaba.fastjson.JSONObject;

import io.finer.erp.jeecg.bas.entity.BasMaterial;
import io.finer.erp.jeecg.stock.vo.ScanIO;

public interface IScan3rdService {

	/**
	 * @Description 根据工序查询MES
	 * @param processId
	 * @return
	 * Create at: 2021-01-22 16:51:47
	 * @author: duany
	 * Revision:
	 *    2021-01-22 16:51:47 - first revision by duany
	 *        
	 */
	Result<?> getProcessMes(String processId);

	/**
	 * @Description 查询源单
	 * @param userId
	 * @param orderType
	 * @param result
	 * @return
	 * Create at: 2020-09-18 14:34:52
	 * @author: duanyong
	 * Revision:
	 *    2020-09-18 14:34:52 - first revision by duanyong
	 *        
	 */
	Result<Object> getOrder(String userId, Integer orderType, Result<Object> result, String inOutType);

	
	/**
	 * @Description 检测是否出库完成
	 * @param mesId
	 * @return
	 * Create at: 2021-01-27 11:22:13
	 * @author: duany
	 * Revision:
	 *    2021-01-27 11:22:13 - first revision by duany
	 *        
	 */
	Boolean checkOutComplete(String mesId);

	/**
	 * @Description 
	 * @param type 工序类型 1复合 2分切 3切张
	 * @param inOutType 1出库 2入库
	 * @return
	 * Create at: 2021-02-03 08:25:32
	 * @author: duany
	 * Revision:
	 *    2021-02-03 08:25:32 - first revision by duany
	 *        
	 */
	Result<?> getInOutMes(Integer type, Integer inOutType);

	/**
	 * @Description 获取mes单的物料分类
	 * @param mesId mes单ID
	 * @return
	 * Create at: 2021-02-03 15:48:49
	 * @author: duany
	 * Revision:
	 *    2021-02-03 15:48:49 - first revision by duany
	 *        
	 */
	Result<?> getMesCategory(String mesId);

	/**
	 * @Description 根据编码查询物料出入库信息
	 * @param code
	 * @return
	 * Create at: 2021-02-04 15:37:40
	 * @author: duany
	 * Revision:
	 *    2021-02-04 15:37:40 - first revision by duany
	 *        
	 */
	Result<?> seeMaterial(String code);

	/**
	 * @Description 根据MEs单获取mes单的客户
	 * @param orderId mes单ID
	 * @return
	 * Create at: 2021-02-17 17:21:18
	 * @author: duany
	 * Revision:
	 *    2021-02-17 17:21:18 - first revision by duany
	 *        
	 */
	Result<?> getMesCustomer(String orderId);
	
	public Boolean checkIsFomula(List<BasMaterial> materials, String mesId);

	/**
	 * @Description 获取物料关联的mes单
	 * @param code
	 * @return
	 * Create at: 2021-02-18 17:07:15
	 * @author: duany
	 * Revision:
	 *    2021-02-18 17:07:15 - first revision by duany
	 *        
	 */
	Result<?> getMaterialOrder(String code);

	/**
	 * @Description 删除物料
	 * @param scanIo
	 * @return
	 * Create at: 2021-02-20 10:25:44
	 * @author: duany
	 * Revision:
	 *    2021-02-20 10:25:44 - first revision by duany
	 *        
	 */
	Result<?> delMaterial(ScanIO scanIo);

	/**
	 * @Description 上托盘操作
	 * @param scanIo
	 * @return
	 * Create at: 2021-02-25 09:02:03
	 * @author: duany
	 * Revision:
	 *    2021-02-25 09:02:03 - first revision by duany
	 *        
	 */
	Result<?> trayTake(ScanIO scanIo);

	/**
	 * @Description 下托盘操作
	 * @param scanIo
	 * @return
	 * Create at: 2021-02-25 13:27:41
	 * @author: duany
	 * Revision:
	 *    2021-02-25 13:27:41 - first revision by duany
	 *        
	 */
	Result<?> trayTakeOff(ScanIO scanIo);

	/**
	 * @Description 查询物料所在托盘
	 * @param scanIo
	 * @return
	 * Create at: 2021-02-25 14:19:53
	 * @author: duany
	 * Revision:
	 *    2021-02-25 14:19:53 - first revision by duany
	 *        
	 */
	Result<?> getMaterialTray(ScanIO scanIo);
	
	/**
	 * @Description 查询制胶mes单
	 * @return
	 * Create at: 2021-03-05 16:36:01
	 * @author: duany
	 * Revision:
	 *    2021-03-05 16:36:01 - first revision by duany
	 *        
	 */
	Result<?> getGlueMes(Integer inOutType);
	
	/**
	 * @Description 批量添加胶水物料 并打印条码
	 * @param scanIo
	 * @return
	 * Create at: 2021-03-06 11:03:35
	 * @author: duany
	 * Revision:
	 *    2021-03-06 11:03:35 - first revision by duany
	 *        
	 */
	Result<?> batchAddGlue(ScanIO scanIo);

	/**
	 * @Description 胶水出库
	 * @param scanIo
	 * @param result
	 * @return
	 * Create at: 2021-03-09 11:34:06
	 * @author: duany
	 * Revision:
	 *    2021-03-09 11:34:06 - first revision by duany
	 *        
	 */
	Result<JSONObject> glueOut(ScanIO scanIo, Result<JSONObject> result);

	/**
	 * @Description 查询物料分类的单位
	 * @param categoryId
	 * @return
	 * Create at: 2021-03-10 14:01:37
	 * @author: duany
	 * Revision:
	 *    2021-03-10 14:01:37 - first revision by duany
	 *        
	 */
	Result<?> categoryUnit(String categoryId);

	/**
	 * @Description 打印销售出库单据
	 * @param scanIo
	 * @return
	 * Create at: 2021-04-09 16:43:24
	 * @author: duany
	 * Revision:
	 *    2021-04-09 16:43:24 - first revision by duany
	 *        
	 */
	Result<?> printSalOut(ScanIO scanIo);

	/**
	 * @Description 查询订单详情和订单出库详情
	 * @param orderId 销售订单ID
	 * @return
	 * Create at: 2021-04-12 16:34:33
	 * @author: duany
	 * Revision:
	 *    2021-04-12 16:34:33 - first revision by duany
	 *        
	 */
	Result<?> getOrderSaleOutInfo(String orderId);

	/**
	 * @Description 代加工出库
	 * @param scan
	 * @return
	 * Create at: 2021-04-20 16:09:34
	 * @author: duany
	 * Revision:
	 *    2021-04-20 16:09:34 - first revision by duany
	 *        
	 */
	Result<?> processingOut(ScanIO scan);
	
	/**
	 * @Description 代加工打印标签
	 * @param scan
	 * @return
	 * Create at: 2021-04-21 10:36:12
	 * @author: duany
	 * Revision:
	 *    2021-04-21 10:36:12 - first revision by duany
	 *        
	 */
	Result<?> processingPrint(ScanIO scan);

	/**
	 * @Description 根据物料编码查询物料详情
	 * @param code
	 * @return
	 * Create at: 2021-05-07 13:52:39
	 * @author: duany
	 * Revision:
	 *    2021-05-07 13:52:39 - first revision by duany
	 *        
	 */
	Result<?> initMaterial(String code);

	/**
	 * @Description 获取所有客户
	 * @return
	 * Create at: 2021-05-07 15:45:54
	 * @author: duany
	 * Revision:
	 *    2021-05-07 15:45:54 - first revision by duany
	 *        
	 */
	Result<?> getAllCustomer();

	/**
	 * @Description 标签重新打印
	 * @param scan
	 * @return
	 * Create at: 2021-05-07 17:29:28
	 * @author: duany
	 * Revision:
	 *    2021-05-07 17:29:28 - first revision by duany
	 *        
	 */
	Result<?> rePrint(ScanIO scan);

	/**
	 * @Description 扫描物料到Log表
	 * @param scan
	 * @return
	 * Create at: 2021-05-12 11:24:51
	 * @author: duany
	 * Revision:
	 *    2021-05-12 11:24:51 - first revision by duany
	 *        
	 */
	Result<?> scanMaterial(ScanIO scan);

	/**
	 * @Description 查看MES单出库物料是否是扫码的物料
	 * @param scan
	 * @return
	 * Create at: 2021-06-21 16:34:11
	 * @author: duany
	 * Revision:
	 *    2021-06-21 16:34:11 - first revision by duany
	 *        
	 */
	Result<?> checkMesMaterial(ScanIO scan);

	/**
	 * @Description 查询MES单
	 * @param procedureId
	 * @return
	 * Create at: 2021-06-22 16:29:15
	 * @author: duany
	 * Revision:
	 *    2021-06-22 16:29:15 - first revision by duany
	 *        
	 */
	Result<?> getCheckMes(String procedureId);

	/**
	 * @Description 采购条码重新打印
	 * @param scan
	 * @return
	 * Create at: 2021-07-16 17:18:45
	 * @author: duany
	 * Revision:
	 *    2021-07-16 17:18:45 - first revision by duany
	 *        
	 */
	Result<Map<String, Object>> rePrintPurchase(ScanIO scan);

	Result<Map<String, Object>> rePrintFh(ScanIO scan);

	Result<Map<String, Object>> rePrintFq(ScanIO scan);

	Result<Map<String, Object>> rePrintQz(ScanIO scan);

	Result<?> rePrintCategory();

	Result<?> rePrintGetMaterial(String code);

	/**
	 * @Description 根据编码获取客户
	 * @param code
	 * @return
	 * Create at: 2021-08-26 10:37:37
	 * @author: duany
	 * Revision:
	 *    2021-08-26 10:37:37 - first revision by duany
	 *        
	 */
	Result<?> getCodeCustomer(String code);

	/**
	 * @Description 查询客户的出库ID
	 * @param customerId
	 * @return
	 * Create at: 2021-08-28 16:55:47
	 * @author: duany
	 * Revision:
	 *    2021-08-28 16:55:47 - first revision by duany
	 *        
	 */
	Result<?> getCustomerOrderSaleOutInfo(String customerId);

	/**
	 * @Description 采购退货时查询物料信息
	 * @param code
	 * @return
	 * Create at: 2021-09-23 10:52:44
	 * @author: duany
	 * Revision:
	 *    2021-09-23 10:52:44 - first revision by duany
	 *        
	 */
	Result<?> purchaseReturnMaterial(String code);

	/**
	 * @Description 采购退货
	 * @param scan
	 * @return
	 * Create at: 2021-09-24 13:57:05
	 * @author: duany
	 * Revision:
	 *    2021-09-24 13:57:05 - first revision by duany
	 *        
	 */
	Result<?> purchaseReturn(ScanIO scan);

	/**
	 * @Description 切张拆包查询物料
	 * @param code 物料编码
	 * @return
	 * Create at: 2021-09-27 09:42:24
	 * @author: duany
	 * Revision:
	 *    2021-09-27 09:42:24 - first revision by duany
	 *        
	 */
	Result<?> splitQzMaterial(String code);

	/**
	 * @Description 切张拆包
	 * @param scan
	 * @return
	 * Create at: 2021-09-27 11:00:28
	 * @author: duany
	 * Revision:
	 *    2021-09-27 11:00:28 - first revision by duany
	 *        
	 */
	Result<?> splitQz(ScanIO scan);
}
